package com.rao.gmall.web.all.controller;

import com.rao.gmall.common.result.Result;
import com.rao.gmall.feign.order.OrderFeignClient;
import com.rao.gmall.model.order.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * @author nzmxfan
 * @create 2021-08-22-18:11
 */

@Controller
public class PayController {

    @Autowired
    OrderFeignClient orderFeignClient;

    @GetMapping("/pay.html")
    public String payHtml(@RequestParam("orderId") Long orderId,
                          Model model){
        // 根据 orderId 获取订单相关信息
        OrderInfo orderInfo = orderFeignClient.getOrderInfo(orderId);

        //这个页面需要数据  id/totalAmount
        model.addAttribute("orderInfo", orderInfo);
        return "payment/pay";
    }
}
